.class public Lcom/kuguo/ui/Workspace;
.super Landroid/view/ViewGroup;


# static fields
.field private static b:Landroid/graphics/Bitmap;

.field private static c:Landroid/graphics/Bitmap;

.field private static d:Landroid/graphics/Bitmap;

.field private static e:Landroid/graphics/Bitmap;


# instance fields
.field a:Z

.field private f:I

.field private g:I

.field private h:I

.field private i:I

.field private j:I

.field private k:Lcom/kuguo/ui/a;

.field private l:I

.field private m:Landroid/content/Context;

.field private n:Ljava/util/List;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/kuguo/ui/Workspace;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    iput-object p1, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const-string v1, "kuguo_res/spot_light.png"

    invoke-static {v0, v1}, Lcom/kuguo/c/d;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    sput-object v0, Lcom/kuguo/ui/Workspace;->b:Landroid/graphics/Bitmap;

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const-string v1, "kuguo_res/spot_default.png"

    invoke-static {v0, v1}, Lcom/kuguo/c/d;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    sput-object v0, Lcom/kuguo/ui/Workspace;->c:Landroid/graphics/Bitmap;

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const-string v1, "kuguo_res/arrow_right.png"

    invoke-static {v0, v1}, Lcom/kuguo/c/d;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    sput-object v0, Lcom/kuguo/ui/Workspace;->d:Landroid/graphics/Bitmap;

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const-string v1, "kuguo_res/arrow_left.png"

    invoke-static {v0, v1}, Lcom/kuguo/c/d;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    sput-object v0, Lcom/kuguo/ui/Workspace;->e:Landroid/graphics/Bitmap;

    const/4 v0, -0x1

    invoke-virtual {p0, v0}, Lcom/kuguo/ui/Workspace;->setBackgroundColor(I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/kuguo/ui/Workspace;->a:Z

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    const/4 v0, 0x5

    invoke-static {p1, v0}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;I)I

    move-result v0

    iput v0, p0, Lcom/kuguo/ui/Workspace;->l:I

    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    iget v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    return v0
.end method

.method public a(I)V
    .locals 5

    const/4 v4, 0x1

    const/4 v3, 0x0

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getScrollX()I

    move-result v0

    add-int/2addr v0, p1

    if-ltz v0, :cond_0

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v1

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v2

    sub-int/2addr v2, v4

    mul-int/2addr v1, v2

    if-gt v0, v1, :cond_0

    invoke-virtual {p0, p1, v3}, Lcom/kuguo/ui/Workspace;->scrollBy(II)V

    :goto_0
    return-void

    :cond_0
    if-gez v0, :cond_1

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getScrollX()I

    move-result v0

    neg-int v0, v0

    invoke-virtual {p0, v0, v3}, Lcom/kuguo/ui/Workspace;->scrollBy(II)V

    goto :goto_0

    :cond_1
    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v0

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v1

    sub-int/2addr v1, v4

    mul-int/2addr v0, v1

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getScrollX()I

    move-result v1

    sub-int/2addr v0, v1

    invoke-virtual {p0, v0, v3}, Lcom/kuguo/ui/Workspace;->scrollBy(II)V

    goto :goto_0
.end method

.method public addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
    .locals 1

    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    instance-of v0, p1, Landroid/widget/GridView;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    check-cast p1, Landroid/widget/GridView;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method

.method public b()V
    .locals 2

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/widget/GridView;

    invoke-virtual {p0}, Landroid/widget/GridView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object p0

    check-cast p0, Lcom/kuguo/ad/n;

    invoke-virtual {p0}, Lcom/kuguo/ad/n;->notifyDataSetChanged()V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public dispatchDraw(Landroid/graphics/Canvas;)V
    .locals 10

    const/4 v4, 0x1

    invoke-super {p0, p1}, Landroid/view/ViewGroup;->dispatchDraw(Landroid/graphics/Canvas;)V

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v0

    if-le v0, v4, :cond_2

    const/4 v1, 0x7

    sget-object v2, Lcom/kuguo/ui/Workspace;->c:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    mul-int v3, v2, v0

    sub-int v4, v0, v4

    mul-int/2addr v4, v1

    add-int/2addr v3, v4

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v4

    sub-int v3, v4, v3

    div-int/lit8 v3, v3, 0x2

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getHeight()I

    move-result v4

    const/16 v5, 0xc

    sub-int/2addr v4, v5

    const/4 v5, 0x0

    :goto_0
    if-ge v5, v0, :cond_1

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->a()I

    move-result v6

    if-eq v5, v6, :cond_0

    sget-object v6, Lcom/kuguo/ui/Workspace;->c:Landroid/graphics/Bitmap;

    :goto_1
    add-int v7, v2, v1

    mul-int/2addr v7, v5

    add-int/2addr v7, v3

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getScrollX()I

    move-result v8

    add-int/2addr v7, v8

    int-to-float v7, v7

    iget v8, p0, Lcom/kuguo/ui/Workspace;->l:I

    sub-int v8, v4, v8

    int-to-float v8, v8

    const/4 v9, 0x0

    invoke-virtual {p1, v6, v7, v8, v9}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    add-int/lit8 v5, v5, 0x1

    goto :goto_0

    :cond_0
    sget-object v6, Lcom/kuguo/ui/Workspace;->b:Landroid/graphics/Bitmap;

    goto :goto_1

    :cond_1
    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const/16 v1, 0xa

    invoke-static {v0, v1}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;I)I

    :cond_2
    return-void
.end method

.method public dispatchTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 7

    const/16 v6, 0x14

    const/16 v5, -0x14

    const/4 v4, 0x1

    const/4 v3, 0x0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    float-to-int v1, v1

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v2

    float-to-int v2, v2

    packed-switch v0, :pswitch_data_0

    :cond_0
    :goto_0
    iget-boolean v0, p0, Lcom/kuguo/ui/Workspace;->a:Z

    if-eqz v0, :cond_1

    const/4 v0, 0x3

    invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->setAction(I)V

    :cond_1
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z

    return v4

    :pswitch_0
    iput-boolean v3, p0, Lcom/kuguo/ui/Workspace;->a:Z

    iput v1, p0, Lcom/kuguo/ui/Workspace;->f:I

    iput v2, p0, Lcom/kuguo/ui/Workspace;->g:I

    iput v1, p0, Lcom/kuguo/ui/Workspace;->h:I

    iput v2, p0, Lcom/kuguo/ui/Workspace;->i:I

    goto :goto_0

    :pswitch_1
    iget v0, p0, Lcom/kuguo/ui/Workspace;->h:I

    sub-int v0, v1, v0

    invoke-static {v0}, Ljava/lang/Math;->abs(I)I

    move-result v0

    iget-object v2, p0, Lcom/kuguo/ui/Workspace;->m:Landroid/content/Context;

    const/16 v3, 0xd

    invoke-static {v2, v3}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;I)I

    move-result v2

    if-le v0, v2, :cond_0

    iput-boolean v4, p0, Lcom/kuguo/ui/Workspace;->a:Z

    iget v0, p0, Lcom/kuguo/ui/Workspace;->h:I

    sub-int/2addr v0, v1

    invoke-virtual {p0, v0}, Lcom/kuguo/ui/Workspace;->a(I)V

    iput v1, p0, Lcom/kuguo/ui/Workspace;->h:I

    goto :goto_0

    :pswitch_2
    iget v0, p0, Lcom/kuguo/ui/Workspace;->f:I

    sub-int v0, v1, v0

    if-lt v0, v5, :cond_2

    if-gt v0, v6, :cond_2

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v0

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    mul-int/2addr v0, v1

    invoke-virtual {p0, v0, v3}, Lcom/kuguo/ui/Workspace;->scrollTo(II)V

    goto :goto_0

    :cond_2
    if-le v0, v6, :cond_3

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    if-lez v1, :cond_3

    iget v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    sub-int/2addr v0, v4

    iput v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v0

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    mul-int/2addr v0, v1

    invoke-virtual {p0, v0, v3}, Lcom/kuguo/ui/Workspace;->scrollTo(II)V

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->k:Lcom/kuguo/ui/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->k:Lcom/kuguo/ui/a;

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    invoke-interface {v0, v1}, Lcom/kuguo/ui/a;->a(I)V

    goto :goto_0

    :cond_3
    if-ge v0, v5, :cond_0

    iget v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v1

    sub-int/2addr v1, v4

    if-ge v0, v1, :cond_0

    iget v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/kuguo/ui/Workspace;->j:I

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getWidth()I

    move-result v0

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    mul-int/2addr v0, v1

    invoke-virtual {p0, v0, v3}, Lcom/kuguo/ui/Workspace;->scrollTo(II)V

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->k:Lcom/kuguo/ui/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->k:Lcom/kuguo/ui/a;

    iget v1, p0, Lcom/kuguo/ui/Workspace;->j:I

    invoke-interface {v0, v1}, Lcom/kuguo/ui/a;->a(I)V

    goto/16 :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method

.method protected onLayout(ZIIII)V
    .locals 8

    const/4 v7, 0x0

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v0

    move v1, v7

    move v2, v7

    :goto_0
    if-ge v1, v0, :cond_1

    invoke-virtual {p0, v1}, Lcom/kuguo/ui/Workspace;->getChildAt(I)Landroid/view/View;

    move-result-object v3

    invoke-virtual {v3}, Landroid/view/View;->getVisibility()I

    move-result v4

    const/16 v5, 0x8

    if-eq v4, v5, :cond_0

    invoke-virtual {v3}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    add-int v5, v2, v4

    invoke-virtual {v3}, Landroid/view/View;->getMeasuredHeight()I

    move-result v6

    invoke-virtual {v3, v2, v7, v5, v6}, Landroid/view/View;->layout(IIII)V

    add-int/2addr v2, v4

    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    return-void
.end method

.method protected onMeasure(II)V
    .locals 3

    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->onMeasure(II)V

    invoke-virtual {p0}, Lcom/kuguo/ui/Workspace;->getChildCount()I

    move-result v0

    const/4 v1, 0x0

    :goto_0
    if-ge v1, v0, :cond_0

    invoke-virtual {p0, v1}, Lcom/kuguo/ui/Workspace;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2, p1, p2}, Landroid/view/View;->measure(II)V

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1

    const/4 v0, 0x0

    return v0
.end method

.method public removeAllViews()V
    .locals 1

    invoke-super {p0}, Landroid/view/ViewGroup;->removeAllViews()V

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    return-void
.end method

.method public removeView(Landroid/view/View;)V
    .locals 1

    invoke-super {p0, p1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    instance-of v0, p1, Landroid/widget/GridView;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/kuguo/ui/Workspace;->n:Ljava/util/List;

    check-cast p1, Landroid/widget/GridView;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method
